<template>
  <el-table :data="data" v-bind="$attrs" v-on="$listeners">
    <template v-for="(column, index) of columns">
      <!-- render -->
      <template v-if="column.render">
        <el-table-column v-bind="Object.assign({}, defaultColumnConfig, column)" :key="index">
          <template slot-scope="scope">
            <extend :render="column.render" :params="scope"></extend>
          </template>
        </el-table-column>
      </template>
      <!-- no render -->
      <template v-else>
        <el-table-column v-bind="Object.assign({}, defaultColumnConfig, column)" :key="index"></el-table-column>
      </template>
    </template>
  </el-table>
</template>
<script>
import extend from './extend.js'
export default {
  components: { extend },
  props: {
    showSelectionColumn: {
      type: Boolean
    },
    data: {
      type: Array
    },
    columns: {
      type: Array
    },
    defaultColumnConfig: {
      type: Object
    }
  }
}
</script>
  
  